<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('诊疗单列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div>
            <form id="formId">
                <!--  <div class="select-list">-->
                <input type="hidden" name="zlId"  th:value="${zlId}"/>
                <!--  </div>-->
            </form>
        </div>

        <!--<div class="col-sm-12 search-collapse">

        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:ncZhenliaoLogs:add">
                <i class="fa fa-plus"></i> 添加
            </a>
            <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:ncZhenliaoLogs:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:ncZhenliaoLogs:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:ncZhenliaoLogs:export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>-->
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
        </div>
    </div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:ncZhenliaoLogs:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:ncZhenliaoLogs:remove')}]];
    var prefix = ctx + "system/ncChickenZhenliaoLogs";

    $(function() {
        var options = {
            url: prefix + "/details",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "诊疗单",
            showExport: true,
            columns: [{
                checkbox: true
            },
                {
                    title: '序号',
                    formatter: function (value, row, index) {
                        return $.table.serialNumber(index);
                    }
                },

                {
                    field : 'roomNum',
                    title : '鸡舍号',
                    sortable: true
                },

                {
                    field : 'illMuns',
                    title : ' 发病次数',
                    sortable: true
                },
                {
                    field : 'symptom',
                    title : '症状',
                    sortable: true
                },
                {
                    field : 'zlStatus',
                    title : '状态:',
                    sortable: true,
                    formatter: function (value, row, index) {
                        if (1 == value) {
                            return "待确认"
                        }
                        if (3 == value) {
                            return "已确认"
                        }

                        return "--";

                    }
                },
                {
                    field : 'reportUser',
                    title : '推送人',
                    sortable: true
                },
                {
                    field : 'zlUser',
                    title : '诊疗人员',
                    sortable: true
                },
                {
                    field : 'drugMethod',
                    title : '用药方法',
                    sortable: true
                },
                {
                    field : 'drugAmount',
                    title : '用药量',
                    sortable: true
                },
                {
                    field : 'unit',
                    title : '用药剂量单位',
                    sortable: true
                },
                {
                    field : 'zlResult',
                    title : '诊疗结果',
                    sortable: true
                },
                {
                    field : 'zlTime',
                    title : '请求时间',
                    sortable: true
                },
                /*{
                    field : 'createBy',
                    title : '创建者',
                    sortable: true
                },
                {
                    field : 'createTime',
                    title : '创建时间',
                    sortable: true
                },*/
                {
                    field : 'remark',
                    title : '备注',
                    sortable: true
                },
               /* {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        if(row.zlStatus == 1){
                            actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.zlId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                            actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.zlId + '\')"><i class="fa fa-remove"></i>删除</a>');
                            return actions.join('');
                        }
                        if(row.zlStatus == 3){
                            actions.push('<a class="btn btn-success btn-xs ' + '" href="javascript:void(0)" onclick="detail(\'' + row.zlId + '\')"><i class="fa fa-edit"></i>详情</a> ');
                            return actions.join('');
                        }
                    }
                }*/]
        };
        $.table.init(options);
    });
    function detail(id){
        var url = ctx + 'system/ncChickenZhenliaoLogs/detail?id='+id;

        $.modal.openTab("检测记录单", url);
    }
</script>
</body>
</html>